package lab02.test03;

/**
 * Created by MacBook on 2017/10/12.
 */
public class Student{
    public static void main(String[] args) {

    }
        //属性：计算机成绩、数学成绩、英语成绩
        float computerScore;
        float mathScore;
        float englishScore;

        //行为：总分、平均分、最高分、最低分，并且可以输出一个学生的完整信息

        //总分
        float sum(){

            return computerScore+mathScore+englishScore;
        }

        //平均分
        float average(){

            return (computerScore+mathScore+englishScore)/3;
        }

        //最高分
        float maxScore(){
            float max=computerScore>mathScore?computerScore:mathScore;
            max=max>englishScore?max:englishScore;
            return max;
        }

        //最低分
        float minScore() {
            float min = computerScore > mathScore ? computerScore : mathScore;
            min = min > englishScore ? min : englishScore;
            return min;
        }

        //打印
        float printfScore(){
            System.out.println(sum());
            System.out.println(average());
            System.out.println(maxScore());
            System.out.println(minScore());
            return printfScore();

        }
    }









